package com.ktg.mes.wm.domain;


import lombok.Data;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.List;

@Data
@Accessors(chain = true)
public class WmStockWillSelectParam {


    /**
     * 查询的库存类型
     */
    private String stockType;

    /**
     * 查询的库存类型
     */
    private String stockTableIdName;

    /**
     * 库存记录查询条件
     */
    private String stockWhereStr;


    /**
     * 使用的表
     */
    private String linkType;

    /**
     * 使用的表记录ID
     */
    private String linkId;


    public String listToInString(List stringsList){
        String str = "";
        if (stringsList != null && stringsList.size() > 0){
            for (int i = 0;i < stringsList.size();i++){
                Object value = stringsList.get(i);
                boolean isNumber = false;
                if (value instanceof Integer
                        || value instanceof Long
                        || value instanceof Double
                        || value instanceof BigDecimal
                        || value instanceof BigInteger
                ){
                    isNumber = true;
                };
                if (i == 0){
                    if (isNumber){
                        str = value.toString();
                    }else {
                        str = str+"'"+value.toString()+"'";
                    }
                }else {
                    if (isNumber){
                        str = str+","+value.toString();
                    }else {
                        str = str+","+"'"+value.toString()+"'";
                    }
                }
            }
        }
        return str;
    }


}
